/**
 * Copy Right: fivemen stduio
 * DateUtils.java
 * create time: Jul 7, 2009
 * author: Nail
 */
package javacommon.util;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.commons.lang.StringUtils;

/**
 * create time :Jul 7, 2009
 * @author : nail
 *
 */
public class DateUtils {
	
	public static String formatDate(Date date,String format)
	{
		 SimpleDateFormat sdf = new SimpleDateFormat(format);
		 return sdf.format(date);
	}
	
	/**
	 * 
	 * create time :Jul 7, 2009
	 * @author : nail
	 *
	 * @return
	 */
	public static String  getCurrentDateTimeStr()
	{
		try {
			Thread.sleep(30);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		 Date date = new Date();
		 System.out.println(" ============= "+System.currentTimeMillis());
		 SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmsssssss");
		 return System.currentTimeMillis()+"";
	}
	
	public static void main(String[] args)
	{
		/*for(int i=0;i<10;i++)		
		{
			try {
				Thread.sleep(30);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssss");
			System.out.println(" ============= "+System.currentTimeMillis());
		}*/
		
		System.out.println(StringUtils.removeEnd(null, ","));
	}

}
